Page({
  data: {
    date: '',
    time: '',
    name: '',
    phone: ''
  },
  bindDateChange: function(e) {
    this.setData({
      date: e.detail.value
    });
  },
  bindTimeChange: function(e) {
    this.setData({
      time: e.detail.value
    });
  },
  bindNameChange: function(e) {
    this.setData({
      name: e.detail.value
    });
  },
  bindPhoneChange: function(e) {
    this.setData({
      phone: e.detail.value
    });
  },
  submitAppointment: function() {
    const { date, time, name, phone } = this.data;
    if (!date || !time || !name || !phone) {
      wx.showToast({
        title: '请填写完整信息',
        icon: 'none'
      });
      return;
    }
    wx.showToast({
      title: '预约成功',
      icon: 'success'
    });
    // 这里可以添加将预约信息发送到服务器的逻辑
  }
});
